package mulMan.gui.view;

import java.util.List;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JMenu;
import javax.swing.event.ChangeListener;

import mulMan.domain.ListOfPlaylists;
import mulMan.domain.Playlist;

public class PlaylistsPopupView extends JMenu implements Observer  {

	private static final long serialVersionUID = -3806771785977911729L;
	
	private List<Playlist> playlists = null;
	
	public PlaylistsPopupView(List<Playlist> playlists) {
		
		super("Add to playlist");

		this.playlists = playlists;
		
		((ListOfPlaylists)this.playlists).addObserver(this);
		for (Playlist iterator : this.playlists) {
			iterator.addObserver(this);
		}
	}

	public void update(Observable arg0, Object arg1) {
		updateUI();
	}
	
	
	public void addshowPlaylistsMenuListListener(ChangeListener aspmll) {
		this.addChangeListener(aspmll);
    }

}
